package com.chapter.Demo03;

import com.sun.jmx.snmp.SnmpUnknownAccContrModelException;

//外部类
public class Outer {
    private String name="xu";
    private int age = 18;
    //静态内部类，级别与外部类相同
    static class Inner{
        private String address = "合肥";
        private String phone = "111";
        //可以包含静态成员
        private static int count = 100;
        public void show(){
            //如何调用外部类属性
            //1.先创建外部类对象
            Outer outer = new Outer();
            //2.调用外部类对象的属性
            System.out.println(outer.name);
            System.out.println(outer.age);
            //调用静态内部类的属性
            System.out.println(address);
            System.out.println(phone);
            //调用静态内部类的静态属性
            System.out.println(Inner.count);
        }
    }
}
